package com.ruoyi.project.commodity.brands.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.commodity.brands.mapper.GoodsBrandsMapper;
import com.ruoyi.project.commodity.brands.domain.GoodsBrands;
import com.ruoyi.project.commodity.brands.service.IGoodsBrandsService;
import com.ruoyi.common.utils.text.Convert;

/**
 * 商品品牌Service业务层处理
 * 
 * @author 艾有宏
 * @date 2021-01-19
 */
@Service
public class GoodsBrandsServiceImpl implements IGoodsBrandsService 
{
    @Autowired
    private GoodsBrandsMapper goodsBrandsMapper;

    /**
     * 查询商品品牌
     * 
     * @param brandId 商品品牌ID
     * @return 商品品牌
     */
    @Override
    public GoodsBrands selectGoodsBrandsById(Long brandId)
    {
        return goodsBrandsMapper.selectGoodsBrandsById(brandId);
    }

    /**
     * 查询商品品牌列表
     * 
     * @param goodsBrands 商品品牌
     * @return 商品品牌
     */
    @Override
    public List<GoodsBrands> selectGoodsBrandsList(GoodsBrands goodsBrands)
    {
        return goodsBrandsMapper.selectGoodsBrandsList(goodsBrands);
    }

    /**
     * 新增商品品牌
     * 
     * @param goodsBrands 商品品牌
     * @return 结果
     */
    @Override
    public int insertGoodsBrands(GoodsBrands goodsBrands)
    {
        return goodsBrandsMapper.insertGoodsBrands(goodsBrands);
    }

    /**
     * 修改商品品牌
     * 
     * @param goodsBrands 商品品牌
     * @return 结果
     */
    @Override
    public int updateGoodsBrands(GoodsBrands goodsBrands)
    {
        return goodsBrandsMapper.updateGoodsBrands(goodsBrands);
    }

    /**
     * 删除商品品牌对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteGoodsBrandsByIds(String ids)
    {
        return goodsBrandsMapper.deleteGoodsBrandsByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除商品品牌信息
     * 
     * @param brandId 商品品牌ID
     * @return 结果
     */
    @Override
    public int deleteGoodsBrandsById(Long brandId)
    {
        return goodsBrandsMapper.deleteGoodsBrandsById(brandId);
    }


    @Override
    public int enableGoodsBrandsById(Long brandId)
    {
        return goodsBrandsMapper.enableGoodsBrandsById(brandId);
    }

    @Override
    public int disableGoodsBrandsById(Long brandId)
    {
        return goodsBrandsMapper.disableGoodsBrandsById(brandId);
    }
}
